namespace EntLibEC.Shopping
{
	using System;
	using System.Data;
	using System.Drawing;
	using System.Web;
	using System.Web.UI.WebControls;
	using System.Web.UI.HtmlControls;

	using EntLibEC.Biz.Basic;
	using EntLibEC.Biz.Online;

	using EntLibEC.Shopping.Include;

	/// <summary>
	///		Summary description for MultiCategoriesHotSale.
	/// </summary>
	public partial class MultiCategoriesHotSale : System.Web.UI.UserControl
	{

		protected void Page_Load(object sender, System.EventArgs e)
		{
			if(IsPostBack == false)
			{
				DataTable dt = CategoryListForHotSaleManager.GetInstance().GetSelectedCategory3();

				if(dt == null || dt.Rows.Count == 0)
				{
					this.Visible = false;
					return;
				}

				foreach(DataRow row in dt.Rows)
				{
					int categorySysNo = (int)row["SysNo"];
					DataTable items = OnlineListManager.GetInstance().GetHotTopProductsForCategory3(categorySysNo);

					HotSaleItemList list = (HotSaleItemList)LoadControl("HotSaleItemList.ascx");
					list.InitCategory2HotSale(items, row["C3Name"].ToString());

					PlaceHolderItemList.Controls.Add(list);
				}
			}
		}
    }
}
